import React , {Component}from 'react';
import {Redirect} from "react-router-dom"
let HocLogin = (WrapComponent)=>{
    return class extends Component {

        render(){
            console.log(this,2222)
            let isLogin = localStorage.getItem("isLogin")
            if (isLogin == "true") {
                return <WrapComponent></WrapComponent>
            } else {
               return <Redirect to="/login"></Redirect>
            }
           
        }
    }
}
export default HocLogin